﻿<!--
    
 @Name：不落阁整站模板源码
 @Author：Absolutely
 @Site：http://www.lyblogs.cn

 -->

<!DOCTYPE html>

<html xmlns:th="http://www.thymeleaf.org">
<html xmlns:wb="http://open.weibo.com/wb">
<head>
    <meta http-equiv="Content-Type" content="text/html; Charset=gb2312">
    <meta http-equiv="Content-Language" content="zh-CN">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"/>
    <title>资源分享</title>
    <link rel="shortcut icon" href="/img/Logo_40.png" type="image/x-icon">
    <!--Layui-->
    <link href="/layui/css/layui.css" rel="stylesheet"/>
    <!--font-awesome-->
    <link href="/plugns/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <!--全局样式表-->
    <link href="/css/global.css" rel="stylesheet"/>
    <!-- 本页样式表 -->
    <link href="/css/resource.css" rel="stylesheet"/>
    <link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_1041315_5v8xchn7xhn.css">
</head>
<body>
<!-- 导航 -->
<nav class="blog-nav layui-header">
    <div class="blog-container" th:if="${thirdLoginUser!=null}">
        <!-- QQ互联登陆 -->
        <a class="blog-user"  href = "javascript:void(0);" onclick ="qqloginOut()">
            <img th:src="@{${thirdLoginUser.avatar}}" alt="点我退出" title="点我退出"/>
            <cite id="nickName" class="layui-hide-xs" th:text="${thirdLoginUser.nickName}"></cite>
        </a>
        <!-- 导航菜单 -->
        <ul class="layui-nav" lay-filter="nav">
            <li class="layui-nav-item layui-this">
                <a href="/blog/toHome"><i class="fa fa-home fa-fw"></i>&nbsp;网站首页</a>
            </li>
            <li class="layui-nav-item">
                <a href="/blog/toArticle"><i class="fa fa-file-text fa-fw"></i>&nbsp;文章专栏</a>
            </li>
            <li class="layui-nav-item">
                <a href="/blog/toResource"><i class="fa fa-tags fa-fw"></i>&nbsp;资源分享</a>
                <dl class="layui-nav-child">
                    <dd><a href="/blog/toResource?categoryName=图片">图片</a></dd>
                    <dd><a href="/blog/toResource?categoryName=源码">源码</a></dd>
                    <dd><a href="/blog/toResource?categoryName=电子书">电子书</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="/blog/toTimeline"><i class="fa fa-hourglass-half fa-fw"></i>&nbsp;点点滴滴</a>
            </li>
            <li class="layui-nav-item">
                <a href="/blog/about"><i class="fa fa-info fa-fw"></i>&nbsp;关于本站</a>
            </li>
        </ul>
        <!-- 手机和平板的导航开关 -->
        <a class="blog-navicon" href="javascript:;">
            <i class="fa fa-navicon"></i>
        </a>
    </div>
    <div class="blog-container" th:if="${thirdLoginUser==null}">
        <!-- QQ互联登陆 -->
        <a href = "javascript:void(0);" onclick ="logins()"  class="blog-user">
            <i class="fa fa-qq"></i>
        </a>
        <!-- 不落阁 -->
        <a class="blog-logo" href="">墨殇</a>
        <!-- 导航菜单 -->
        <ul class="layui-nav" lay-filter="nav">
            <li class="layui-nav-item ">
                <a href="/blog/toHome"><i class="fa fa-home fa-fw"></i>&nbsp;网站首页</a>
            </li>
            <li class="layui-nav-item">
                <a href="/blog/toArticle"><i class="fa fa-file-text fa-fw"></i>&nbsp;文章专栏</a>
            </li>
            <li class="layui-nav-item  layui-this">
                <a href="/blog/toResource"><i class="fa fa-tags fa-fw"></i>&nbsp;资源分享</a>
                <dl class="layui-nav-child">
                    <dd><a href="/blog/toResource?categoryName=图片">图片</a></dd>
                    <dd><a href="/blog/toResource?categoryName=源码">源码</a></dd>
                    <dd><a href="/blog/toResource?categoryName=电子书">电子书</a></dd>
                </dl>
            </li>
            <li class="layui-nav-item">
                <a href="/blog/toTimeline"><i class="fa fa-hourglass-half fa-fw"></i>&nbsp;点点滴滴</a>
            </li>
            <li class="layui-nav-item">
                <a href="/blog/about"><i class="fa fa-info fa-fw"></i>&nbsp;关于本站</a>
            </li>
        </ul>
        <!-- 手机和平板的导航开关 -->
        <a class="blog-navicon" href="javascript:;">
            <i class="fa fa-navicon"></i>
        </a>
    </div>
</nav>
<!-- 主体（一般只改变这里的内容） -->
<div class="blog-body">
    <div class="blog-container">
        <blockquote class="layui-elem-quote sitemap layui-breadcrumb shadow">
            <a href="home.html" title="网站首页">网站首页</a>
            <a><cite>资源分享</cite></a>
        </blockquote>
        <div class="blog-main">
            <div class="blog-main">
                <div class="resource-main">
                    <div class="resource shadow" th:each="resource : ${pageUtil.data}">
                        <div class="resource-cover">
                            <a href="javascript:layer.msg(&#39;这里填演示地址&#39;)" target="_blank">
                                <img th:if="${resource.fileType.equals('.docx')||resource.fileType.equals('.doc')}"  src="/img/resource/word.jpg" alt="resource"/></i>
                                <img th:if="${resource.fileType.equals('.xlsx')||resource.fileType.equals('.xls')}"  src="/img/resource/excel.jpg" alt="resource"/></i>
                                <img th:if="${resource.fileType.equals('.ppt')||resource.fileType.equals('.pptx')}"  src="/img/resource/word.jpg" alt="resource"/></i>
                                <img th:if="${resource.fileType.equals('.exe')}"  src="/img/resource/exe.jpg" alt="resource"/></i>
                                <img th:if="${resource.fileType.equals('.pdf')}"  src="/img/resource/pdf.jpg" alt="resource"/></i>
                                <img th:if="${resource.fileType.equals('.rar')||resource.fileType.equals('.gz')||resource.fileType.equals('.zip')}"  src="/img/resource/yasuobao1.jpg" alt="resource"/></i>
                                <img th:if="${resource.fileType.equals('.png')||resource.fileType.equals('.jpg')}"  th:src="@{${resource.webUrl}}" alt="resource"/></i>
                                <img th:if="${resource.fileType.equals('.js')}"  src="/img/resource/js.jpg"  alt="resource"/></i>
                            </a>
                        </div>
                        <h1 class="resource-title"><a href="javascript:layer.msg(&#39;这里填演示地址&#39;)"
                                                      target="_blank" th:text="${resource.fileName}"></a></h1>
                        <p class="resource-abstract"></p>
                        <div class="resource-info">
                            <div class="div-a iconfont icon-class-o" th:text="${resource.categoryName}"></div>
                            <div class="div-b iconfont icon-zuozhe" th:text="${resource.createName}"></div>
                            <div class="clear"></div>
                        </div>
                        <div class="resource-footer">
                            <a class="layui-btn layui-btn-small layui-btn-primary"
                               th:href="@{/file/download(fileName=${resource.fileName},url=${resource.webUrl},remoteName=${resource.remoteName})}" target="_blank"><i
                                    class="iconfont icon-xiazai5"></i>下载</a>
                        </div>
                    </div>

                    <!-- 清除浮动 -->
                    <div class="clear"></div>
                </div>
                <div id="demo2" style="text-align: center"></div>
            </div>
        </div>
    </div>
</div>
<!-- 底部 -->
<footer class="blog-footer">
    <wb:share-button addition="simple" type="button" language="zh_cn"></wb:share-button>
    <p><span>Copyright</span><span>&copy;</span><span>2018-2019</span><a href="http://www.moshang.work">墨殇</a><span>Design By moshang</span>
    </p>
    <p><a href="http://www.miibeian.gov.cn/" target="_blank">豫ICP备18034337号</a><a href="/toLogin"
                                                                                  target="_blank">后台登录管理</a></p>
</footer>
<!--侧边导航-->
<ul class="layui-nav layui-nav-tree layui-nav-side blog-nav-left layui-hide" lay-filter="nav">
    <li class="layui-nav-item ">
        <a href="/blog/toHome"><i class="fa fa-home fa-fw"></i>&nbsp;网站首页</a>
    </li>
    <li class="layui-nav-item">
        <a href="/blog/toArticle"><i class="fa fa-file-text fa-fw"></i>&nbsp;文章专栏</a>
    </li>
    <li class="layui-nav-item layui-this">
        <a href="/blog/toResource"><i class="fa fa-tags fa-fw"></i>&nbsp;资源分享</a>
    </li>
    <li class="layui-nav-item">
        <a href="/blog/toTimeline"><i class="fa fa-road fa-fw"></i>&nbsp;点点滴滴</a>
    </li>
    <li class="layui-nav-item">
        <a href="/blog/about"><i class="fa fa-info fa-fw"></i>&nbsp;关于本站</a>
    </li>
</ul>
<!--分享窗体-->
<div class="blog-share layui-hide">
    <div class="blog-share-body">
        <div style="width: 200px;height:100%;">
            <div class="bdsharebuttonbox">
                <a class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
                <a class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
                <a class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
                <a class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
            </div>
        </div>
    </div>
</div>
<!--遮罩-->
<div class="blog-mask animated layui-hide"></div>
<!-- layui.js -->
<script src="/layui/layui.js"></script>
<!-- 全局脚本 -->
<script src="/js/web/global.js"></script>
<script th:inline="javascript" type="text/javascript">
    layui.use(['laypage', 'layer', 'jquery', 'laydate', 'element'], function () {
        var laypage = layui.laypage,
            layer = layui.layer,
            $ = layui.jquery,
            element = layui.element,
            laydate = layui.laydate;
        var pcount = [[${pageUtil.count}]];// 总记录数
        laypage.render({
            elem: 'demo2'
            , count: pcount //总记录数
            , layout: ['count', 'prev', 'page', 'next', 'refresh', 'skip']
            , theme: '#00A0E9'
            , limit: 10//每页十条
            , curr: [[${pageUtil.page}]]
            , jump: function (obj, first) {
                //obj包含了当前分页的所有参数，比如：
                console.log(obj.curr); //得到当前页，以便向服务端请求对应页的数据。
                console.log(obj.limit); //得到每页显示的条数
                console.log(obj.count); //得到每页显示的条数
                if (!first) {
                    window.location.href = encodeURI("toResource?page=" + obj.curr + "&limit=" + obj.limit);
                }
            }
        });
        //触发事件
        element.on('tab(demo)', function (data) {
            console.log(this); //当前Tab标题所在的原始DOM元素
            console.log(data.index); //得到当前Tab的所在下标
            console.log(data.elem); //得到当前的Tab大容器
            $(".layui-tab-title li").hover(function () {
                var $i = $(this).index();
                $(this).addClass("child-nav-btn-this").siblings().removeClass("child-nav-btn-this");
                $(".layui-tab-content .layui-tab-item").eq($i).addClass("layui-show").siblings().removeClass("layui-show");
            });

        });

    });
    var  redirectUrl=window.location.href;
    function logins(){
        location.href="/qq/auth?status=2&redirectUrl="+redirectUrl;
    }
    function qqloginOut(){
        location.href="/qqloginOut?redirectUrl="+redirectUrl;
    }
</script>
</body>
</html>